package com.example.facecompare.security.service;//package com.example.mengchuangyuan.security.service;
//
//import com.example.mengchuangyuan.user.userinfo.entity.Userinfo;
//import com.example.mengchuangyuan.user.userinfo.mapper.UserinfoMapper;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.stereotype.Service;
//
//import java.util.Collections;
//
//@Service
//public class UserService implements UserDetailsService {
//    @Autowired
//    private UserinfoMapper userinfoMapper;
//
//    @Override
//    public UserDetails loadUserByUsername(String inviteCode) throws UsernameNotFoundException {
//        Userinfo user = userinfoMapper.selectUserById(inviteCode);
//        if (user == null) {
//            throw new UsernameNotFoundException("User not found");
//        }
//        return new org.springframework.security.core.userdetails.User(
//                user.getOpenid(), user.getInviteCode(), Collections.emptyList()
//        );
//    }
//}
